<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
    <title>充值页面</title>
    <base href="<%=basePath %>"/>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="favicon.ico" >
    <link rel="Shortcut Icon" href="favicon.ico" />
    <link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="assets/H-ui/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui.admin/css/style.css" />

    <link rel="stylesheet" type="text/css" href="assets/css/main.css">

</head>
<body>
<section class="Hui-article-box1">
    <div class="Hui-article">
        <div id="div111">充值页面</div>
        <article class="cl pd-20" id="pd-2008">
            <div class="text-c">
                <input type="text" class="input-text" style="width:250px" placeholder="输入充值的金额" name="userMoney1" id="userMoney1">
                <button type="button" onclick="recharge()" class="btn btn-success radius" ><%--<i class="Hui-iconfont">&#xe665;</i> --%>充值</button>
            </div>
            <div id="divspean3" class="divspean1">姓名：${user.userName}</div>
            <div id="divspean2" class="divspean1">账户余额：${user.userMoney}</div>
        </article>
    </div>
</section>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="assets/H-ui/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="assets/H-ui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="assets/H-ui/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="assets/H-ui/static/h-ui.admin/js/H-ui.admin.page.js"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="assets/H-ui/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="assets/H-ui/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="assets/H-ui/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">

    function recharge(){//条件查询按钮
        // console.log("22222");
        if ($("#userMoney1").val() == "" ||$("#userMoney1").val() <= 0) {
            alert("输入的金额有误，请重新输入！！");
            return;
        }
        var userMoney1 = $("#userMoney1").val();
        $.ajax({
            url : "operationUser/recharge.action",
            data : {"userMoney1" : userMoney1},
            type : "post",
            dataType : "text",
            // dataType : "json",
            success : function (res) {

                    if(res=="success"){
                        alert("充值成功！！！");
                        window.location.href="operationUser/showUser.action";
                    }else if(res=="error"){
                        alert("充值失败！！！");
                        window.location.href="operationUser/showRecharge.action";
                    }
            }
        });
    }

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>